<template>
    <el-card class="box-card">
        <el-table :data="properties" style="width: 100%">
            <el-table-column prop="name" label="名称"></el-table-column>
            <el-table-column prop="nameText" label="显示文本"></el-table-column>
            <el-table-column inline-template width="130px">
                <template>
                    <el-tooltip class="tip" placement="top" content="编辑选项">
                        <el-button type="primary" size="small" icon="edit" @click="handleEdit(true)"></el-button>
                    </el-tooltip>
                    <el-tooltip class="tip" placement="top" content="删除选项">
                        <el-button type="danger" size="small" icon="delete"></el-button>
                    </el-tooltip>
                </template>
            </el-table-column>
        </el-table>
        <el-col :span="24" class="lastCol">
            <el-button type="primary" @click="handleEdit(false)">添加选项</el-button>
        </el-col>
    </el-card>
</template>
<style>
    .hiddenLabel .el-form-item__label {
        -moz-backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
        visibility: hidden;
    }
</style>
<script type="text/javascript">
    export default {
        data() {
            return {
                properties: [{
                    name: 'origin',
                    nameText: '产地'
                }]
            }
        },
        methods: {
            handleEdit(name) {
                this.$router.push(`/options/undefined/edit`);
                if (name == true) {
                    this.choseType = true;
                } else {
                    this.choseType = false;
                }
            },
        }
    }

</script>